package org.wall.controller

import grails.test.mixin.TestFor
import spock.lang.Specification
import grails.plugins.rest.client.*

/**
 * See the API for {@link grails.test.mixin.web.ControllerUnitTestMixin} for usage instructions
 */
@TestFor(MapaController)
class MapaControllerSpec extends Specification {

    def setup() {
    }

    def cleanup() {
    }

    void "test something"() {
    }

    def "Test proxy configuration"() {
        when:"RestBuilder is configured with proxy settings"
            def rest = new RestBuilder(proxy:['localhost':8080])
            def proxyAddress = rest.restTemplate.requestFactory?.@proxy?.address()

        then:"The proxy settings are correct"
            proxyAddress != null
            proxyAddress.hostName == "localhost"
            proxyAddress.port == 8080
    }


}
